
import { createDrawChannel, getAiConsumerPoint, getDrawChannels, getAiCate, getAiCateConfig } from "@/api";
import { CateChildType, CateType } from '@/types/apiResType'


export interface ICateTypeStore {
    editorCate: CateType
    currentCateChildType: CateChildType
    initCateInfo: () => void
    setCurrentCateChild: (data: CateChildType) => void
}

const CateTypeStore = (): ICateTypeStore => {
    return {
        editorCate: [],
        currentCateChildType: {
            cateid: '',
            name: "",
            icon: "", classify_id: ''
        },
        async initCateInfo() {
            const res = await getAiCate()
            if (res.code) {
                this.editorCate = res.data
            }
        },
        setCurrentCateChild(data: CateChildType) {
            this.currentCateChildType = data;
        }
    };
};

export default CateTypeStore;
